// javamaps
// Copyright (c) 2010 Lup Gratian
package Rendering;

// Ofera informatii despre contextul in care s-a inceput o actiune
// (click cu butonul stanga/dreapta, tasta Shift era apasata, etc.).
public class Modifier {
    public static int BUTTON_LEFT   = 1;
    public static int BUTTON_RIGHT  = 2;
    public static int BUTTON_MIDDLE = 4;
    public static int KEY_SHIFT     = 8;
    public static int KEY_ALT       = 16;
    public static int KEY_CTRL      = 32;

    /*
    * Membrii.
    */
    private int state_;

    /*
    * Constructori.
    */
    public Modifier() {}

    public Modifier(int state) { 
        state_ = state;
    }

    /*
    * Metode publice.
    */
    public void Set(int modifier) {
        state_ |= modifier;
    }

    public boolean IsSet(int modifier) {
        return (state_ & modifier) != 0;
    }

    public void Reset() { 
        state_ = BUTTON_LEFT;
    }
}